#pragma once
#include "vec3f.h"
#include <set>

using namespace std;


typedef struct Ball {
	Vec3f v;
	Vec3f pos;
	float r;
	Vec3f color;
}Ball;

class SimpleOctree
{
public:
	SimpleOctree(void);
	~SimpleOctree(void);

	Vec3f corner1; //Min X,Y,Z
	Vec3f corner2; //Max X,Y,Z
	Vec3f venter; //min +mix /2, X,Y,Z

	SimpleOctree *children[2][2][2];

	bool hasChildren;

	set<Ball*> balls;

	int depth;

	int numBalls;

	void addBall(Ball*ball);

	void divideOctree();

	void get_subsets(set<Ball*> &subsets);



};

